package com.zheng.study.company.service;

import com.zheng.study.base.bean.Result;
import com.zheng.study.base.service.BaseService;
import com.zheng.study.company.entity.Company;
import com.zheng.study.company.entity.Department;

import java.util.List;

/**
 * newFile
 * ============================================================================
 * author : dzw
 * createDate:  2018/8/24 。
 * ============================================================================
 */
public interface DepartmentService extends BaseService<Department, String> {

	/**
	 * 判断一个部门是否存在有子部门
	 */
	boolean isParentDepartment(Department department);

	/**
	 * 获取企业下所有顶级部门
	 */
	List<Department> getRootDepartments(Company company);

	/**
	 * 获取部门下的部门列表
	 */
	List<Department> getDepartments(Company company, Department department);

	/**
	 * 更新路径和层级
	 */
	void updatePath(Department department);

	Result deleteDepartment(Department department);
}
